package com.warrantyhotel.android.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.warrantyhotel.android.R;
import com.warrantyhotel.android.model.AccountIdentifyObject;

public class AccounIdentifyAdapter extends ArrayAdapter<AccountIdentifyObject> {

	private Context context;
	private AccountIdentifyObject[] items;

	public AccounIdentifyAdapter(Context context, int textViewResourceId, AccountIdentifyObject[] items) {
		super(context, textViewResourceId, items);
		this.context = context;
		this.items = items;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = convertView;
		if (v == null) {
			LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(R.layout.item, null);
		}
		TextView tt = (TextView) v.findViewById(R.id.item_acc);
		tt.setText(items[position].getValue());

		
//		TextView type = (TextView) v.findViewById(android.R.id.text2);
//		type.setText(items[position].getAccountIdentityTypeID());
		return v;
	}

}
